'use strict';

var fs = require('fs');


// 同步读
var data = fs.readFileSync('fs/sample.txt', 'utf-8');
console.log(data);


// 异步读
fs.readFile('fs/sample.txt', 'utf-8', function (err, data) {
    if (err) {
        console.log(err);
    } else {
        console.log(data);
    }
});